import type { CardListData, CardListParams, CardParams } from "@/types/card"
import { request } from "@/utils/reuqest"

export const getCardListAPI = (params: CardListParams) => {
    return request<CardListData>('/parking/card/list', 'get', params)
}
/**
 * 新增月卡
 * @data
 * @returns
 */
export const createCardAPI = (data: CardParams) => {
    return request('/parking/card', 'POST', data)
}
/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export const delCardAPI = (id: string) => {
    return request(`/parking/card/${id}`, 'DELETE')
}
/**
 * 批量删除月卡
 * @param {*} ids [1,2,3]
 * @returns
 */
export const delAllCardAPI = (ids: number[]) => {
    return request(`/parking/card/${ids.join(',')}`, 'DELETE')
}